Page({
    onLoad: function (options) {
        console.log('onLoad_detail我进来了');
        console.log('doc_id========'+options.doc_id);
        var id=options.doc_id;
        this.yys_docinfo(id);
    },

    yys_docinfo(id) {
        var timestamp = Date.parse(new Date());
        var that = this;
        //链接远程服务器
        swan.request({
            url: 'https://api.cndzys.com/index.php/yys_docinfo', 
            method: 'GET',
            data: { id: id },
            header: { 'content-type': 'application/json' },
            success: function (res) {
                that.setData({ data_user: res.data.data_user})
                that.setData({ doctor_name_art: res.data.doctor_name_art})
            },
        });
    },

    yys_menutype(id,uid) {
        var timestamp = Date.parse(new Date());
        var that = this;
        //链接远程服务器
        swan.request({
            url: 'https://api.cndzys.com/index.php/yys_menutype', 
            method: 'GET',
            data: { id: id,uid: uid },
            header: { 'content-type': 'application/json' },
            success: function (res) {
                that.setData({ doctor_name_art: res.data.doctor_name_art})
            },
        });
    },

    doctor(event) {
        this.setData({ menutype: 0})
        var uid = event.currentTarget.id
        this.yys_menutype('1',uid);
        
    },
    doctors(event) {
        this.setData({ menutype: 1})
        var uid = event.currentTarget.id
        this.yys_menutype('2',uid);
        
    },
    qandadetail(event) {
        var wenda_id = event.currentTarget.id
        swan.navigateTo({ url:'../qandadetail/qandadetail?wenda_id=' + wenda_id  });
    },
    articledetail(event) {
        var art_id = event.currentTarget.id
        swan.navigateTo({ url:'../articledetail/articledetail?art_id=' + art_id  });
    },
});
